﻿using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace BlogApi.Models
{
    /// <summary>
    /// 评论表
    /// </summary>
    public class Comment:BaseEntity
    {
        /// <summary>
        /// 评论的用户ID
        /// </summary>
        [ForeignKey(nameof(User))]
        public Guid UserId { get; set; }
        public User User { get; set; }
        /// <summary>
        /// 评论的文章ID
        /// </summary>
        [ForeignKey(nameof(Article))]
        public Guid ArticleId { get; set; }
        public Article Article { get; set; }
        /// <summary>
        /// 评论的内容
        /// </summary>
        [Required,Column(TypeName ="ntext")]
        public string Content { get; set; }
    }
}
